package com.sp.scmdb.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

import com.sp.scmdb.common.HibernateObject;

@Entity
@Table(name = "Security_Training")
public class SecurityTraining extends HibernateObject{

	/** 标题 */
	@Column(name = "title")
	private String title;
	
	/** 培训交底类型id */
	@Column(name = "trainingTypeIds")
	private String trainingTypeIds;
	
	/** 日期 */
	@Column(name = "trainDate")
	private String trainDate;
	
	/** 交底人 */
	@Column(name = "trainMans")
	private String trainMans;
	
	/** 系统创建日期 */
	@Column(name = "createdDate")
	@Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
	private DateTime createdDate;
	
	/** 创建人 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creatorId", insertable = true, updatable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	private User user;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTrainingTypeIds() {
		return trainingTypeIds;
	}

	public void setTrainingTypeIds(String trainingTypeIds) {
		this.trainingTypeIds = trainingTypeIds;
	}

	public String getTrainDate() {
		return trainDate;
	}

	public void setTrainDate(String trainDate) {
		this.trainDate = trainDate;
	}

	public String getTrainMans() {
		return trainMans;
	}

	public void setTrainMans(String trainMans) {
		this.trainMans = trainMans;
	}

	public DateTime getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(DateTime createdDate) {
		this.createdDate = createdDate;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
